import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'

//token
export function getToken() {
  return sessionStorage.getItem(TokenKey)
}
export function setToken(token) {
  return sessionStorage.setItem(TokenKey, token)
}
export function removeToken() {
  return sessionStorage.clear()
}

//用户id
export function setUserId(userId) {
    return Cookies.set("userId",userId)    
}
export function getUserId() {
    return Cookies.get("userId")    
}
export function removeUserId(userId) {
    return Cookies.remove("userId")    
}

//sessionStorage清空
export function clearSession(){
    return sessionStorage.clear()
}

//传递用户类型参数
export function getUserType() {
    return sessionStorage.getItem("userType")
}  
export function setUserType(userType) {
    return sessionStorage.setItem("userType", userType)
}